<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
  <meta charset="UTF-8">
  <title>Student Management System </title>

  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
</head>

<body style="background: #f2eada">
<div class="container">
  <h1 style="text-align: center; color: blue; font-family: Arial, sans-serif;">学生管理系统</h1>
  <hr>
  <h2 style="color: #27342b">修改学生信息</h2>

  <form action="#" th:action="@{/saveStudent}" th:object="${student}" method="POST">

    <!-- Add hidden form field to handle update -->
    <input type="hidden" th:field="*{id}" />

    <input type="text" th:field="*{name}" class="form-control mb-4 col-4" width="50px" style="background-color: #94d6da; border-radius: 10px;">

    <input type="text" th:field="*{sex}"  class="form-control mb-4 col-4" width="50px" style="background-color: #94d6da; border-radius: 10px;">

    <input type="text" th:field="*{age}" class="form-control mb-4 col-4" width="50px" style="background-color: #94d6da; border-radius: 10px;">

    <input type="text" th:field="*{status}" class="form-control mb-4 col-4" width="50px" style="background-color: #94d6da; border-radius: 10px;">

    <input type="text" th:field="*{ticy}"  class="form-control mb-4 col-4" width="50px" style="background-color: #94d6da; border-radius: 10px;">

    <!--    <input type="text" th:field="*{className}"  class="form-control mb-4 col-4">-->
    <select class="form-control mb-4 col-4" th:field="*{className}" style="border: 2px solid #7fb80e; border-radius: 10px;">
      <option value="未分配">选择班级</option>
      <option th:each="classroom : ${listclass}" th:value="${classroom.name}" th:text="${classroom.name}"></option>
    </select>

    <button type="submit" class="btn btn-info col-2"> 修改 </button>
  </form>
  <hr>
  <a th:href="@{/}" th:color="red" class="btn btn-primary btn-sm mb-3"> 返回首页 </a>
</div>
</body>

</html>